"""
自定义线程类
"""
from threading import Thread


class MyThread(Thread):
    def __init__(self, target=None, args=(), kwargs={}):
        super().__init__()
        self.target = target
        self.args = args
        self.kwargs = kwargs

    def run(self):
        self.target(*self.args, **self.kwargs)


def play(player: str, sport: str):
    print(player + sport)


t = MyThread(target=play, kwargs={'player': 'Alice', 'sport': '羽毛球'})
t.start()
t.join()
